<template>
  <div>
    御剑乘风来,除魔天地间!======father
    {{ count }}==={{ name }}====<button
      @click="$store.commit('rename', '雪虎')"
    >
      改名</button
    >===={{ $store.state.user.msg }}
    <button @click="$store.commit('user/changeMsg', '子谦')">改msg</button>
    <p><slot></slot></p>
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  name: "",
  data() {
    return {};
  },
  created() {
    console.log(this.$store.state.count);
  },
  computed: {
    // count() {
    //   return this.$store.state.count;
    // },
    //利用展开运算符将数据的数组展开到数据里面,类似于count函数,数组里面是名字
    ...mapState(["count", "name"]),
  },
  methods: {},
};
</script>
<style lang='less'  scoped>
</style>
